[Solved] Forbidden 403 when calling our own node


#1

We cannot make a POST requests (in this case calling a contract function) to our own node for some reason. I get the following error:

POST http://167.**.**.49:30**/encode-calldata 403 (Forbidden)

Thanks.


#2

hey, do you do the call using the sdk or manually?

what is the full path you are querying (except ip), also whats the data you pass and corresponding contract?


#3

also are you trying to call this on an aeternity node? It’s an endpoint of the https://github.com/aeternity/aesophia_http standalone compiler.


#4

It all happens on the client side, using the latest JS-SDK.

    const wallet = yield Universal({
        url: 'http://167.**.**.49:3013',
        internalUrl: 'http://167.**.**.49:3113',
        keypair: {
            publicKey,
            secretKey,
        },
        nativeMode: true,
        networkId: 'ae_uat',
        compilerUrl: 'http://167.**.**.49:3080',
    });
    const contract = yield wallet.getContractInstance(source, {
        contractAddress: 'ct_TQYquk3e5WGGyj5wCp2T6NRN5ZKQsAFufbWwMh1g2FG9faRQA',
    });

    const result = yield contract.call(
        'deposit',
        [tokenAddress, depositAmount, beneficiaryAddress, referralAddress],
        options
    );


#5

looks alright to me, I think I am unable to reproduce without knowing the version of sdk, node and compiler you are running as well as the contract source.


#6

after I was provided the contract source in private by @kraykov we figured out that there was a type error in the arguments that were passed to the compiler. The endpoint did also return an error message about this, together with status 403.