Hi,
I’m trying to compile a smart contract with aeproject. I have aeproject node running, but when I try aeproject node I’m getting this error:
Contract '/home/aepp/contracts/ExampleContract.aes has not been compiled'
connect ECONNREFUSED 127.0.0.1:3080
When I look into the docker ps, there is not any container listening at that port:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
00309704285f aeternity/aeternity:v5.0.2 "bin/aeternity conso…" 23 minutes ago Up 23 minutes (healthy) 3013-3015/tcp, 3113/tcp aeternity-daily-payments_node2_1
d8b39fb6efc1 aeternity/aeternity:v5.0.2 "bin/aeternity conso…" 23 minutes ago Up 23 minutes (healthy) 3013-3015/tcp, 3113/tcp aeternity-daily-payments_node1_1
29ecfb0e7fd8 nginx:1.13.8 "nginx -g 'daemon of…" 23 minutes ago Up 23 minutes 80/tcp, 0.0.0.0:3001-3003->3001-3003/tcp aeternity-daily-payments_proxy_1
72e136a8376e aeternity/aeternity:v5.0.2 "bin/aeternity conso…" 23 minutes ago Up 23 minutes (healthy) 3013-3015/tcp, 3113/tcp aeternity-daily-payments_node3_1
Is there any error in the compiler?
I’m using
OS: Ubuntu 18.04
Aeproject: 2.0.1
Python: 2.7.15
Docker compose 1.25
Thanks
1 Like
Did you start the compiler using aeproject compiler
? (cc @martingrigorov.chain)
ups… nope. Sorry, my fault. I thought that aeproject compile directly started the neccesary containers, now is working. Thanks!
Other question, maybe is not for the post, buy I’m using a Lib “List.aes” to manage libs, and I’m include It with include "List.aes. When I use the online IDE it is automatically resolve, buy locally I’m getting this error:
File to include ‘List.aes’ not found. Check your path or it is from Sophia default library
How can include this file? Is there in any place on github?
Thanks
Hi @ialberquilla
Can you share your contract?
Thanks
Hi @alekseytsekov.chain,
Yes, is this:
include "List.aes"
contract TaskProjects =
//Record for store the projects
record project =
{ id : int,
creatorAddress : address,
name : string,
description : string,
tasks : list(int)}
record task =
{ id : int,
projectId : int,
assignedTo : address,
name : string,
description : string}
//State record
record state =
{ projects : map(int, project),
projectsLength : int,
tasks : map(int, task),
taskLength : int}
//Init function
entrypoint init() =
{ projects = {},
projectsLength = 0,
tasks = {},
taskLength = 0 }
//Returns a project for a given id
entrypoint getProject(index : int) : project =
switch(Map.lookup(index, state.projects))
None => abort("There was no project with this index registered.")
Some(x) => x
//Returns a task for a given id
entrypoint getTask(index : int) : task =
switch(Map.lookup(index, state.tasks))
None => abort("There was no task with this index registered.")
Some(x) => x
//Register a new project in the blockchain
stateful entrypoint registerProject(name' : string, description': string) =
let index = getProjectsLength() + 1
let project = { id = index, creatorAddress = Call.caller, name = name', description = description', tasks = []}
put(state{ projects[index] = project,projectsLength = index })
//Register a new task for the given project
stateful entrypoint registerTask(name' : string, projectId': int, description': string) =
let taskId = getTaskLength() + 1
let task = {id = taskId, projectId = projectId', name = name', description = description', assignedTo = Call.caller}
put(state{ tasks[taskId] = task, taskLength = taskId })
let project = getProject(projectId')
List.insert_at(taskId, 0, project.tasks)
put(state{ projects[project.id] = project })
//Returns project lenght
entrypoint getProjectsLength() : int =
state.projectsLength
//Returns taks lenght
entrypoint getTaskLength() : int =
state.taskLength
this issue should be fixed with the latest version of aeproject
as far as I know (cc @martingrigorov.chain)
Hey @ialberquilla
With the latest version of aeproject
your contract is compiled successfully. Maybe the info message is a little confusing and not telling that the contract is compiled with the included library. We’ll work on that to be more understandable.
File to include 'List.aes' not found. Check your path or it is from Sophia default library
Contract '/Users/path-to-contract/ExampleContract.aes has been successfully compiled'```
Hi @alekseytsekov.chain! Ok, thanks. I saw the warning a and thought that this file was needed, thanks!
The file is part of the standard library, and it is bundled with the compiler. There was a bug in how the standard library contracts was included, hence the problem. But it was resolved a while ago and with the latest versions it should just work.
1 Like