Skip to content

Commit

Permalink
fix(mainnet): fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
xavier506 committed Apr 16, 2022
2 parents 16dceee + 1c4752f commit 9633491
Show file tree
Hide file tree
Showing 123 changed files with 8,721 additions and 8,387 deletions.
11 changes: 8 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ HAPI_POSTGRES_DB=eosrate
HAPI_POSTGRES_SCHEMA=public
HAPI_SERVER_PORT=9090
HAPI_SERVER_ADDRESS=0.0.0.0
HAPI_EOS_API_ENDPOINT=https://jungle.eosio.cr
HAPI_EOS_API_ENDPOINT=https://jungle.edenia.cloud
HAPI_EOS_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906
HAPI_PROXY_CONTRACT=proxyaccount
HAPI_RATING_CONTRACT=rateproducer
HAPI_HYPERION_API=https://jungle3history.cryptolions.io
HAPI_HYPERION_START_AT=2022-03-01T00:00:00.000+00:00
HAPI_HASURA_URL=http://hasura:8080/v1/graphql
HAPI_HASURA_ADMIN_SECRET=myadminsecretkey

# HASURA
HASURA_GRAPHQL_DATABASE_URL=postgres://user:password@eosrate_postgres:5432/eosrate
Expand All @@ -37,8 +42,8 @@ REACT_APP_MAINNET_VERSION=true
REACT_APP_EDEN_CONTRACT=genesis.eden
REACT_APP_GRAPHQL_HTTP_URL=http://localhost:8080/v1/graphql
REACT_APP_GRAPHQL_WS_URL=ws://localhost:8080/v1/graphql
REACT_APP_EOS_API_URL=https://jungle.eosio.cr
REACT_APP_EOS_API_HOST=jungle.eosio.cr
REACT_APP_EOS_API_URL=https://jungle.edenia.cloud
REACT_APP_EOS_API_HOST=jungle.edenia.cloud
REACT_APP_EOS_API_PORT=443
REACT_APP_EOS_API_PROTOCOL=https
REACT_APP_EOS_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push-master-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,18 @@ jobs:
HAPI_SERVER_PORT: 9090
HAPI_POSTGRES_USER: ${{ secrets.HAPI_POSTGRES_USER }}
HAPI_POSTGRES_PASSWORD: ${{ secrets.HAPI_POSTGRES_PASSWORD }}
HAPI_HASURA_URL: ${{ secrets.HAPI_HASURA_URL }}
HAPI_HASURA_ADMIN_SECRET: ${{ secrets.HAPI_HASURA_ADMIN_SECRET }}
HAPI_PROXY_CONTRACT: regproxyinfo
HAPI_RATING_CONTRACT: rateproducer
HAPI_POSTGRES_DB: eosrate
HAPI_POSTGRES_HOST: postgres
HAPI_POSTGRES_PORT: 5432
HAPI_POSTGRES_SCHEMA: public
HAPI_EOS_API_ENDPOINT: https://api.main.alohaeos.com
HAPI_EOS_CHAIN_ID: aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906
HAPI_HYPERION_API: https://api.eossweden.org
HAPI_HYPERION_START_AT: '2022-03-01T00:00:00.000+00:00'
# hasura
HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }}
HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/push-staging-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ jobs:
HAPI_SERVER_PORT: 9090
HAPI_POSTGRES_USER: ${{ secrets.HAPI_POSTGRES_USER }}
HAPI_POSTGRES_PASSWORD: ${{ secrets.HAPI_POSTGRES_PASSWORD }}
HAPI_HASURA_URL: ${{ secrets.HAPI_HASURA_URL }}
HAPI_HASURA_ADMIN_SECRET: ${{ secrets.HAPI_HASURA_ADMIN_SECRET }}
HAPI_PROXY_CONTRACT: proxyaccount
HAPI_RATING_CONTRACT: rateproducer
HAPI_POSTGRES_DB: eosrate
HAPI_POSTGRES_HOST: postgres
HAPI_POSTGRES_PORT: 5432
HAPI_POSTGRES_SCHEMA: public
HAPI_EOS_API_ENDPOINT: https://jungle3.cryptolions.io
HAPI_EOS_CHAIN_ID: 2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
HAPI_HYPERION_API: https://jungle3history.cryptolions.io
HAPI_HYPERION_START_AT: '2022-03-01T00:00:00.000+00:00'
# hasura
HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }}
HASURA_GRAPHQL_ADMIN_SECRET: ${{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}
Expand All @@ -99,4 +104,4 @@ jobs:
NAMESPACE: jungle-eosrate
K8S_BUILD_DIR: build_k8s
with:
args: version && make deploy-kubernetes
args: version && make deploy-kubernetes
32 changes: 28 additions & 4 deletions contracts/rateproducer/include/rateproducer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ using eosio::public_key;

/*
* this namespace is used to map producer_info and voter_info tables
* within the local scope of this contract, the follow functions :is_blockproducer,
* within the local scope of this contract, the follow functions: is_blockproducer,
* get_voters, get_proxy, is_active_proxy relay on these tables.
* this approaches came from this thread :
* this approaches came from this thread:
* https://eosio.stackexchange.com/questions/4676/check-within-smart-contract-if-an-account-is-a-proxy
*/
namespace eosio {
Expand Down Expand Up @@ -347,7 +347,7 @@ namespace eoscostarica {
)
typedef eosio::singleton<"globalconfig"_n, config> config_table;

struct rateproducer : public eosio::contract {
struct rateproducer : public eosio::contract {
// Use the base class constructors
using eosio::contract::contract;

Expand Down Expand Up @@ -505,6 +505,28 @@ namespace eoscostarica {
float * development,
uint32_t * ratings_cntr,
float * average);

/**
*
* Add a comment for a bp
*
* @param user - Commenter account,
* @param bp - Block Producer account name
* @param comment - Commentary
*
*/
void logcomment (name user, name bp, std::string comment);

/**
*
* Give like to a comment
*
* @param transaction - Comment transaction
* @param user - Commenter account,
* @param like - true/false
*
*/
void loglike (std::string transaction, name user, bool like);

/**
*
Expand Down Expand Up @@ -604,6 +626,8 @@ namespace eoscostarica {
action(rmrate, user, bp, ricardian_contract(rmrate_ricardian)),
action(migrate, ricardian_contract(migrate_ricardian)),
action(freeupram, ricardian_contract(freeupram_ricardian)),
action(migratestats, ricardian_contract(migratestats_ricardian)))
action(migratestats, ricardian_contract(migratestats_ricardian)),
action(logcomment, user, bp, comment, ricardian_contract(logcomment_ricardian)),
action(loglike, transaction, user, like, ricardian_contract(loglike_ricardian)))

} // namespace eoscostarica
46 changes: 46 additions & 0 deletions contracts/rateproducer/rateproducer_mainnet.abi
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,42 @@
"base": "",
"fields": []
},
{
"name": "logcomment",
"base": "",
"fields": [
{
"name": "user",
"type": "name"
},
{
"name": "bp",
"type": "name"
},
{
"name": "comment",
"type": "string"
}
]
},
{
"name": "loglike",
"base": "",
"fields": [
{
"name": "transaction",
"type": "string"
},
{
"name": "user",
"type": "name"
},
{
"name": "like",
"type": "bool"
}
]
},
{
"name": "ratings_v2",
"base": "",
Expand Down Expand Up @@ -192,6 +228,16 @@
"name": "migratestats",
"type": "migratestats",
"ricardian_contract": "---\nspec_version: 0.1.0\ntitle: Update rateproducer stats\nsummary: The intent of the `{{ migratestats }}` action is to remove from stats table under rateproducer scope the eden ratings averages.\n---"
},
{
"name": "logcomment",
"type": "logcomment",
"ricardian_contract": "---\nspec_version: 0.1.0\ntitle: Add additional information about block producer\nsummary: The intent of the `{{ logcomment }}` action is to add additional information and optinions of users about block producers.\n---"
},
{
"name": "loglike",
"type": "loglike",
"ricardian_contract": "---\nspec_version: 0.1.0\ntitle: Add additional feedback about comment\nsummary: The intent of the `{{ loglike }}` action is to add feedback of users comment about block producers.\n---"
}
],
"tables": [
Expand Down
Loading

0 comments on commit 9633491

Please sign in to comment.