Hello guys,
I set up a testnet node and a compiler node through docker. The command that I use for the testnet node is the following:
docker run -d --restart=always --name ae-testnet -p 3013:3013 -p 3015:3015 -v ~/.aeternity/myaeternity.yaml:/home/aeternity/.aeternity/aeternity/aeternity.yaml -v myaedb:/home/aeternity/node/data/mnesia aeternity/aeternity
and this is my configuration file:
chain:
persist: true
peers:
# UAT
- aenode://pp_QU9CvhAQH56a2kA15tCnWPRJ2srMJW8ZmfbbFTAy7eG4o16Bf@52.10.46.160:3015
- aenode://pp_2vhFb3HtHd1S7ynbpbFnEdph1tnDXFSfu4NGtq46S2eM5HCdbC@18.195.109.60:3015
- aenode://pp_27xmgQ4N1E3QwHyoutLtZsHW5DSW4zneQJ3CxT5JbUejxtFuAu@13.250.162.250:3015
- aenode://pp_DMLqy7Zuhoxe2FzpydyQTgwCJ52wouzxtHWsPGo51XDcxc5c8@13.53.161.215:3015
fork_management:
network_id: ae_uat
I’m trying to interact with the following contract using javascript SDK:
contract Identity =
type state = ()
function main(x : int) = x + 1
function go(who : address) = who
This is how I interact with the contract:
const fs = require('fs')
const contractFile = fs.readFileSync('./identity.aes');
const source = contractFile.toString();
const { Universal: Ae } = require('@Albert/aepp-sdk');
console.log(source);
Ae({ url: 'mynode:3013', internalUrl: 'mynode:3013', compilerUrl: 'mynode:3080', keypair: {
publicKey: 'mypublickey',
secretKey: 'mysecretkey,
}}).then(async (ae) => {
ae.height().then(height => {
console.log('Current Block', height);
});
const contract = await ae.getContractInstance(source, { contractAddress: 'ct_2XL4hnKxNXV6BAEq7Q6Dp7dP7RRqxrntY34M5DnZ4kceETUNg7' }).catch(err => { console.log(err); });
const result = await contract.call('main', ['34'], { callStatic: true });
console.log(result);
const decoded = await result.decode();
console.log(decoded);
})
SDK version is 3.1.0.
Docker image is latest.
So if I connect to https://sdk-testnet.aepps.com/ instead of my own node it works ok. When I use my node, it successfully connects and gets the blockchain height but it is unable to interact with the contract and I get the following error:
Error: While calling dryRunTxs (body), Request failed with status code 404
I believe it is something with configuration file or the way I run the container.
Appreciate your support!
1 Like
A support for this issue would be highly appreciated.
Hello @weidex_team
you will have to enable the debug/internal endpoints in your http api:
http:
internal:
debug_endpoints: true
listen_address: 0.0.0.0
port: 3113
they are disabled by default since release 1.3.0 as not every node should have them public.
# About this release
[This][this-release] is a maintenance release.
It contains feature refinements, in addition to renaming of the canonical location and name of the software.
Please refer to the notes below for details and backward compatibility.
Regarding renaming, this release:
* Deprecates Docker Hub repository `aeternity/epoch` in favor of `aeternity/aeternity`. Older images have been migrated to `aeternity/aeternity`. The `latest` tag of `aeternity/epoch` will always point to `1.3.0` until the repository is deleted in the future.
* **Users fetching the Docker image must fetch it from the new Docker Hub repo `aeternity/aeternity`.**
* Changes Docker images username (and home path) to aeternity.
* **Users specifying for the Docker image a custom user configuration or persisting the chain data must update how they use the image.** Please refer to the dedicated [page][docker] for details.
* Updates package names to use `aeternity` prefix e.g. `aeternity-1.3.0-ubuntu-x86_64.tar.gz` instead of `epoch-1.3.0-ubuntu-x86_64.tar.gz`.
* **Users retrieving the published release binaries for this release and following must update their scripts.**
* Renames OSX/macOS package name to use `macos-x86_64` suffix e.g. `aeternity-1.3.0-macos-x86_64.tar.gz` instead of `epoch-1.3.0-osx-10.13.6.tar.gz`.
* **Users retrieving the published macOS release binaries for this release and following must update their scripts.**
* Deprecates the `bin/epoch` binary for operating the node in favor of `bin/aeternity`. The `bin/epoch` binary prints a deprecation warning to standard error then redirects the invocation to the `bin/aeternity` one until `aeternity/epoch` is deleted at the next major version.
* Deprecates GitHub repository `aeternity/epoch` in favor of `aeternity/aeternity`. Traffic is [redirected](https://help.github.com/articles/renaming-a-repository/) from `aeternity/epoch` to `aeternity/aeternity`.
Regarding feature refinements, this release:
* Disables internal debug API endpoints by default. To enable setup epoch.yaml `http > internal > debug_endpoints` to `true`.
This file has been truncated. show original
Hope this solves your issue
1 Like
Additionally you would have to foreward port 3113
in docker and use this as internal url when you initialize your node.
1 Like
Works perfectly, thanks @philipp.chain
1 Like